package chenji.gunapi.pluginmessage.event;

import org.bukkit.plugin.Plugin;

public abstract class PackageListener implements Comparable<PackageListener> {
	private Plugin p;

	public abstract void onPackageReceive(GunAPIPackageReceiveEvent e);

	public abstract void onPackageSend(GunAPIPackageSendEvent e);

	public abstract Priority getPriority();

	@Override
	public final int compareTo(PackageListener obj) {
		if (obj.getPriority().getValue() > this.getPriority().getValue()) {
			return 1;
		}
		if (obj.getPriority().getValue() < this.getPriority().getValue()) {
			return -1;
		}
		return 0;
	}

	public final void setPlugin(Plugin p) {
		this.p = p;
	}

	public final Plugin getPlugin() {
		return this.p;
	}
}
